<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <#assign base=request.contextPath  />
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <title>飞机修理任务级别分析统计系统</title>
    <link rel='shortcut Icon' type='image/x-icon' href='${base}/static/win10/img/api.png'>
    <script type="text/javascript" src="${base}/static/win10/js/jquery-2.2.4.min.js"></script>
    <link href="${base}/static/win10/css/animate.css" rel="stylesheet">
    <link rel="stylesheet" href="${base}/static/win10/component/font-awesome-4.7.0/css/font-awesome.min.css">
    <script type="text/javascript" src="${base}/static/win10/component/layer-v3.0.3/layer/layer.js"></script>
    <link href="${base}/static/win10/component/fontawesome-free-5.11.2-web/css/all.css" rel="stylesheet">
    <!--load all styles -->
    <link href="${base}/static/win10/css/default.css" rel="stylesheet">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
    <script type="text/javascript" src="${base}/static/win10/js/win10.js"></script>
    <script type="text/javascript" src="${base}/static/win10/component/layui/layui.js"></script>
    <style>
        * {
            font-family: "Microsoft YaHei", 微软雅黑, "MicrosoftJhengHei", 华文细黑, STHeiti, MingLiu
        }

        /*磁贴自定义样式*/
        .win10-block-content-text {
            line-height: 44px;
            text-align: center;
            font-size: 16px;
        }
    </style>

</head>
<body>
<div id="win10">

    <div class="desktop">

        <div id="win10-shortcuts" class="shortcuts-hidden">

            <@shiro.hasPermission name="menu:账户信息">
                <div class="shortcut" onclick="Win10.openUrl('${base}/api/user/admin/main.html','账户信息')">
            <img  class="icon fa " src="${base}/static/win10/img/fj11/user.png">
                <span class="title"></span>
                <div class="title">账户信息</div>
                </div>
            </@shiro.hasPermission>

            <#--框架调用权限  有将显示 没有不显示-->
            <@shiro.hasPermission name="menu:角色信息">
                <div class="shortcut" onclick="Win10.openUrl('${base}/api/role/admin/main.html','角色信息')">
            <img  class="icon fa " src="${base}/static/win10/img/fj11/role.png">
                <span class="title"></span>
                <div class="title">角色信息</div>
                </div>
            </@shiro.hasPermission>


            <@shiro.hasPermission name="menu:数据字典">
                <div class="shortcut" onclick="Win10.openUrl('${base}/api/sysDict/admin/main.html','数据字典')">
            <img  class="icon fa " src="${base}/static/win10/img/fj11/data.png">
                <span class="title"></span>
                <div class="title">数据字典</div>
                </div>
            </@shiro.hasPermission>




        </div>


        <div id="win10-desktop-scene"></div>
    </div>

    <div id="win10-menu" class="hidden">

        <div class="list win10-menu-hidden animated animated-slideOutLeft">

            <@shiro.hasPermission name="menu:账户信息">
                <div class="item has-sub-up">
                    <i class="black icon fa fa-address-card"></i><span class="title">账户信息</span>
                </div>

                <@shiro.hasPermission name="menu:角色信息">
                    <div class="sub-item" onclick="Win10.openUrl('${base}/api/role/main.html','角色信息')"
                    style="display: block;">
                    角色信息
                    </div>
                </@shiro.hasPermission>



                <@shiro.hasPermission name="menu:账户信息">
                    <div class="sub-item" onclick="Win10.openUrl('${base}/api/user/main.html','账户信息')"
                    style="display: block;">
                    账户信息
                    </div>
                </@shiro.hasPermission>



            </@shiro.hasPermission>



            <div class="item" onclick="Win10.exit()">
                <i class="black icon fa fa-power-off fa-fw"></i><span class="title">关闭</span>
            </div>

            <div class="item" onclick="window.location.href='${base}/api/user/logout.html'">
                <i class="black icon fa fa-power-off fa-fw"></i><span class="title">退出</span>
            </div>

        </div>
        <!--磁铁-->
        <div class="blocks">
            <@shiro.hasPermission name="menu:用户信息">
                <div class="menu_group">
                <div class="title">用户管理</div>
                <@shiro.hasPermission name="menu:用户信息">
                    <div class="block " loc="1,1" size="6,4">
                    <div class="content blue" onclick="Win10.openUrl('${base}/api/user/admin/main.html','用户信息')">
                    <div style="font-size:100px;line-height: 132px;margin: 0 auto ;display: block"
                         class="fa fa-fw fa-address-card win10-block-content-text"></div>
                    <div class="win10-block-content-text" style="font-size: 22px">用户信息</div>
                    </div>
                    </div>
                </@shiro.hasPermission>
                <@shiro.hasPermission name="menu:角色信息">
                    <div class="block" loc="1,5" size="6,4">
                    <div class="content" onclick="Win10.openUrl('${base}/api/role/admin/main.html','角色信息')">
                    <div style="font-size:100px;line-height: 132px;margin: 0 auto ;display: block"
                         class="fa fa-fw fa-female win10-block-content-text"></div>
                    <div class="win10-block-content-text" style="font-size: 22px">角色信息</div>
                    </div>
                    </div>
                </@shiro.hasPermission>
                </div>
            </@shiro.hasPermission>

        </div>
        <div id="win10-menu-switcher"></div>
    </div>
    <div id="win10_command_center" class="hidden_right">

        <div class="title">
            <h4 style="float: left">消息中心 </h4>

            <span id="win10_btn_command_center_clean_all">全部清除</span>
        </div>
        <div class="msgs">


        </div>
    </div>
    <div id="win10_task_bar">
        <div id="win10_btn_group_left" class="btn_group">
            <div id="win10_btn_win" class="btn"><span class="fab fa-windows"></span></div>
            <div class="btn" id="win10-btn-browser"><span class="fab fa-internet-explorer"></span></div>
        </div>
        <div id="win10_btn_group_middle" class="btn_group"></div>
        <div id="win10_btn_group_right" class="btn_group">
            <div class="btn" id="win10_btn_time"></div>
            <div class="btn" id="win10_btn_command"><span id="win10-msg-nof" class="far fa-apit-alt"></span></div>
            <div class="btn" id="win10_btn_show_desktop"></div>
        </div>
    </div>
</div>
<audio id="myaudio" src="${base}/aa.mp3" autoplay="autoplay" controls="controls" style="display: none"
       preload="preload" muted="muted">
    不支持audio标签
</audio>
<script>
    var url = "ws://39.100.147.206:1884";
    Win10.onReady(function () {
        /* layui.use('laydate', function() {
             var laydate = layui.laydate;

         })*/
        //连接websocket

        //判断当前浏览器是否支持WebSocket
        if ('WebSocket' in window) {
            websocket = new WebSocket(url + "/websocket/" + new Date().getTime() + "/admin");
        } else {
            //  layer.msg("当前浏览器不支持的消息通道")
        }

        //连接发生错误的回调方法
        websocket.onerror = function () {
            //   layer.msg("消息通道发生错误")
        };

        //连接成功建立的回调方法
        websocket.onopen = function (event) {
            // websocket.send("你好")
        };

        //接收到消息的回调方法
        websocket.onmessage = function (event) {
            var msg = JSON.parse(event.data);
            //   alert(event.data)
            if (msg.type == 1) {//有新订单
                Win10.newMsg(new Date(), msg.msg)
                document.getElementById("myaudio").volume = 1.0;
                document.getElementById("myaudio").play();
            }
        };

        //连接关闭的回调方法
        websocket.onclose = function () {
            websocket = new WebSocket(url + "/websocket/" + new Date().toLocaleString().getTime() + "/admin");
        };

        //监听窗口关闭事件，当窗口关闭时，主动去关闭websocket连接，防止连接还没断开就关闭窗口，server端会抛异常。
        window.onbeforeunload = function () {
            websocket.close();
        }


        //关闭连接
        function closeWebSocket() {
            websocket.close();
        }

        //设置壁纸
        Win10.setBgUrl({
            main: '${base}/static/win10/img/background/index1.png',
            mobile: '${base}/static/win10/img/wallpapers/mobile.jpg',
        });


        Win10.setAnimated([
            'animated flip',
            'animated bounceIn',
        ], 0.2);
        //典型用法(桌面菜单)
        Win10.setContextMenu('#win10>.desktop', [
            ['进入全屏', function () {
                Win10.enableFullScreen()
            }], //菜单项+点击回调
            ['退出全屏', function () {
                Win10.disableFullScreen()
            }],
            '|', //分隔符
            ['刷新', function () {
                Win10.rendershortcuts();
            }],
            ['最小化所有', function () {
                Win10.hideWins()
            }],
            ['关闭所有', function () {
                Win10.closeAll()
            }],
        ]);
    });

</script>
</body>

</html>